//
//  HJPhotoItem.m
//  KaiChat
//
//  Created by lx on 2023/10/30.
//

#import "HJPhotoItem.h"
#import "HJChatMessageModel.h"

@implementation HJPhotoItem

+ (HJPhotoItem *)itemWithBlock:(void (^)(HJPhotoItem *item))block {
    HJPhotoItem *item = [[HJPhotoItem alloc] init];
    if (block) block(item);
    return item;
}

+ (HJPhotoItem *)itemWithMessageModel:(HJChatMessageModel *)model {
    HJPhotoItem *item = [[HJPhotoItem alloc] init];
    item.thumbUrl = model.thumbnailUrl;
    item.localPath = model.localPath.lastPathComponent.tj_IMFileCachePath;
    item.originalUrl = model.fileUrl;
    item.thumbImage = [UIImage imageWithContentsOfFile:model.thumbnailPath.lastPathComponent.tj_IMFileCachePath];
    return item;
}

- (void)loadData {
    
}

@end
